home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / xpcom / nsIErrorService.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  8KB  |  191 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIErrorService.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIErrorService_h__
  6. #define __gen_nsIErrorService_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17.  
  18. /* starting interface:    nsIErrorService */
  19. #define NS_IERRORSERVICE_IID_STR "e72f94b2-5f85-11d4-9877-00c04fa0cf4a"
  20.  
  21. #define NS_IERRORSERVICE_IID \
  22.   {0xe72f94b2, 0x5f85, 0x11d4, \
  23.     { 0x98, 0x77, 0x00, 0xc0, 0x4f, 0xa0, 0xcf, 0x4a }}
  24.  
  25. /**
  26.  * nsIErrorService: This is an interim service that allows nsresult codes to be mapped to 
  27.  * string bundles that can be used to look up error messages. String bundle keys can also
  28.  * be mapped. 
  29.  *
  30.  * This service will eventually get replaced by extending xpidl to allow errors to be defined.
  31.  * (http://bugzilla.mozilla.org/show_bug.cgi?id=13423).
  32.  */
  33. class NS_NO_VTABLE nsIErrorService : public nsISupports {
  34.  public: 
  35.  
  36.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IERRORSERVICE_IID)
  37.  
  38.   /**
  39.      * Registers a string bundle URL for an error module. Error modules are obtained from
  40.      * nsresult code with NS_ERROR_GET_MODULE.
  41.      */
  42.   /* void registerErrorStringBundle (in short errorModule, in string stringBundleURL); */
  43.   NS_IMETHOD RegisterErrorStringBundle(PRInt16 errorModule, const char *stringBundleURL) = 0;
  44.  
  45.   /**
  46.      * Registers a string bundle URL for an error module.
  47.      */
  48.   /* void unregisterErrorStringBundle (in short errorModule); */
  49.   NS_IMETHOD UnregisterErrorStringBundle(PRInt16 errorModule) = 0;
  50.  
  51.   /**
  52.      * Retrieves a string bundle URL for an error module.
  53.      */
  54.   /* string getErrorStringBundle (in short errorModule); */
  55.   NS_IMETHOD GetErrorStringBundle(PRInt16 errorModule, char **_retval) = 0;
  56.  
  57.   /**
  58.      * Registers a key in a string bundle for an nsresult error code. Only the code portion
  59.      * of the nsresult is used (obtained with NS_ERROR_GET_CODE) in this registration. The
  60.      * string bundle key is used to look up internationalized messages in the string bundle.
  61.      */
  62.   /* void registerErrorStringBundleKey (in nsresult error, in string stringBundleKey); */
  63.   NS_IMETHOD RegisterErrorStringBundleKey(nsresult error, const char *stringBundleKey) = 0;
  64.  
  65.   /**
  66.      * Unregisters a key in a string bundle for an nsresult error code. 
  67.      */
  68.   /* void unregisterErrorStringBundleKey (in nsresult error); */
  69.   NS_IMETHOD UnregisterErrorStringBundleKey(nsresult error) = 0;
  70.  
  71.   /**
  72.      * Retrieves a key in a string bundle for an nsresult error code. If no key is registered
  73.      * for the specified nsresult's code (obtained with NS_ERROR_GET_CODE), then the stringified
  74.      * version of the nsresult code is returned.
  75.      */
  76.   /* string getErrorStringBundleKey (in nsresult error); */
  77.   NS_IMETHOD GetErrorStringBundleKey(nsresult error, char **_retval) = 0;
  78.  
  79. };
  80.  
  81. /* Use this macro when declaring classes that implement this interface. */
  82. #define NS_DECL_NSIERRORSERVICE \
  83.   NS_IMETHOD RegisterErrorStringBundle(PRInt16 errorModule, const char *stringBundleURL); \
  84.   NS_IMETHOD UnregisterErrorStringBundle(PRInt16 errorModule); \
  85.   NS_IMETHOD GetErrorStringBundle(PRInt16 errorModule, char **_retval); \
  86.   NS_IMETHOD RegisterErrorStringBundleKey(nsresult error, const char *stringBundleKey); \
  87.   NS_IMETHOD UnregisterErrorStringBundleKey(nsresult error); \
  88.   NS_IMETHOD GetErrorStringBundleKey(nsresult error, char **_retval); 
  89.  
  90. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  91. #define NS_FORWARD_NSIERRORSERVICE(_to) \
  92.   NS_IMETHOD RegisterErrorStringBundle(PRInt16 errorModule, const char *stringBundleURL) { return _to RegisterErrorStringBundle(errorModule, stringBundleURL); } \
  93.   NS_IMETHOD UnregisterErrorStringBundle(PRInt16 errorModule) { return _to UnregisterErrorStringBundle(errorModule); } \
  94.   NS_IMETHOD GetErrorStringBundle(PRInt16 errorModule, char **_retval) { return _to GetErrorStringBundle(errorModule, _retval); } \
  95.   NS_IMETHOD RegisterErrorStringBundleKey(nsresult error, const char *stringBundleKey) { return _to RegisterErrorStringBundleKey(error, stringBundleKey); } \
  96.   NS_IMETHOD UnregisterErrorStringBundleKey(nsresult error) { return _to UnregisterErrorStringBundleKey(error); } \
  97.   NS_IMETHOD GetErrorStringBundleKey(nsresult error, char **_retval) { return _to GetErrorStringBundleKey(error, _retval); } 
  98.  
  99. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  100. #define NS_FORWARD_SAFE_NSIERRORSERVICE(_to) \
  101.   NS_IMETHOD RegisterErrorStringBundle(PRInt16 errorModule, const char *stringBundleURL) { return !_to ? NS_ERROR_NULL_POINTER : _to->RegisterErrorStringBundle(errorModule, stringBundleURL); } \
  102.   NS_IMETHOD UnregisterErrorStringBundle(PRInt16 errorModule) { return !_to ? NS_ERROR_NULL_POINTER : _to->UnregisterErrorStringBundle(errorModule); } \
  103.   NS_IMETHOD GetErrorStringBundle(PRInt16 errorModule, char **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetErrorStringBundle(errorModule, _retval); } \
  104.   NS_IMETHOD RegisterErrorStringBundleKey(nsresult error, const char *stringBundleKey) { return !_to ? NS_ERROR_NULL_POINTER : _to->RegisterErrorStringBundleKey(error, stringBundleKey); } \
  105.   NS_IMETHOD UnregisterErrorStringBundleKey(nsresult error) { return !_to ? NS_ERROR_NULL_POINTER : _to->UnregisterErrorStringBundleKey(error); } \
  106.   NS_IMETHOD GetErrorStringBundleKey(nsresult error, char **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetErrorStringBundleKey(error, _retval); } 
  107.  
  108. #if 0
  109. /* Use the code below as a template for the implementation class for this interface. */
  110.  
  111. /* Header file */
  112. class nsErrorService : public nsIErrorService
  113. {
  114. public:
  115.   NS_DECL_ISUPPORTS
  116.   NS_DECL_NSIERRORSERVICE
  117.  
  118.   nsErrorService();
  119.  
  120. private:
  121.   ~nsErrorService();
  122.  
  123. protected:
  124.   /* additional members */
  125. };
  126.  
  127. /* Implementation file */
  128. NS_IMPL_ISUPPORTS1(nsErrorService, nsIErrorService)
  129.  
  130. nsErrorService::nsErrorService()
  131. {
  132.   /* member initializers and constructor code */
  133. }
  134.  
  135. nsErrorService::~nsErrorService()
  136. {
  137.   /* destructor code */
  138. }
  139.  
  140. /* void registerErrorStringBundle (in short errorModule, in string stringBundleURL); */
  141. NS_IMETHODIMP nsErrorService::RegisterErrorStringBundle(PRInt16 errorModule, const char *stringBundleURL)
  142. {
  143.     return NS_ERROR_NOT_IMPLEMENTED;
  144. }
  145.  
  146. /* void unregisterErrorStringBundle (in short errorModule); */
  147. NS_IMETHODIMP nsErrorService::UnregisterErrorStringBundle(PRInt16 errorModule)
  148. {
  149.     return NS_ERROR_NOT_IMPLEMENTED;
  150. }
  151.  
  152. /* string getErrorStringBundle (in short errorModule); */
  153. NS_IMETHODIMP nsErrorService::GetErrorStringBundle(PRInt16 errorModule, char **_retval)
  154. {
  155.     return NS_ERROR_NOT_IMPLEMENTED;
  156. }
  157.  
  158. /* void registerErrorStringBundleKey (in nsresult error, in string stringBundleKey); */
  159. NS_IMETHODIMP nsErrorService::RegisterErrorStringBundleKey(nsresult error, const char *stringBundleKey)
  160. {
  161.     return NS_ERROR_NOT_IMPLEMENTED;
  162. }
  163.  
  164. /* void unregisterErrorStringBundleKey (in nsresult error); */
  165. NS_IMETHODIMP nsErrorService::UnregisterErrorStringBundleKey(nsresult error)
  166. {
  167.     return NS_ERROR_NOT_IMPLEMENTED;
  168. }
  169.  
  170. /* string getErrorStringBundleKey (in nsresult error); */
  171. NS_IMETHODIMP nsErrorService::GetErrorStringBundleKey(nsresult error, char **_retval)
  172. {
  173.     return NS_ERROR_NOT_IMPLEMENTED;
  174. }
  175.  
  176. /* End of implementation class template. */
  177. #endif
  178.  
  179. // The global nsIErrorService:
  180. #define NS_ERRORSERVICE_NAME   "Error Service" 
  181. #define NS_ERRORSERVICE_CONTRACTID "@mozilla.org/xpcom/error-service;1"
  182. #define NS_ERRORSERVICE_CID                          \
  183. { /* 744afd5e-5f8c-11d4-9877-00c04fa0cf4a */         \
  184.     0x744afd5e,                                      \
  185.     0x5f8c,                                          \
  186.     0x11d4,                                          \
  187.     {0x98, 0x77, 0x00, 0xc0, 0x4f, 0xa0, 0xcf, 0x4a} \
  188. }
  189.  
  190. #endif /* __gen_nsIErrorService_h__ */
  191.